package org.yzh.protocol;

import io.github.yezhihao.protostar.DataType;
import io.github.yezhihao.protostar.annotation.Field;
import io.github.yezhihao.protostar.annotation.Message;
import org.yzh.protocol.basics.GTMessage;
import org.yzh.protocol.commons.GTID;
import org.yzh.protocol.commons.MessageId;
import org.yzh.protocol.commons.transform.AttributeConverter;
import org.yzh.protocol.commons.transform.AttributeConverterYue;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * @author yezhihao
 * @home https://gitee.com/yezhihao/jt808-server
 */
@Message(GTID.实时信息上报)
public class RealtimeInfo extends GTMessage {

    @Field(index = 0, type = DataType.BYTES, length = 6, desc = "数据采集时间")
    private LocalDateTime deviceTime;

    @Field(index = 1, type = DataType.DWORD, desc = "type")
    private int warnBit;

    @Field(index = 28, type = DataType.MAP, desc = "位置附加信息", converter = RealtimeInfoConverter.class)
    private Map<Integer, Object> attributes;

}